import cv2
import numpy

img = cv2.imread("d:\\test\\cluo.jpg", 1)
# # print(len(img))
# # px = img[100, 100]
# # print(px)
# # blue = img[100, 100, 0]
# # print(blue)
# # print(img.item(10, 10, 2))
# # img.itemset((10, 10, 2), 223)
# # print(img.item(10, 10, 2))
# print(img.shape)  # 返回图片的长、宽、颜色值，如果是灰度图片，只有长宽
# print(img.size, img.dtype)#604800=600*336*3 uint8


# 目标：移动球的位置
ball = img[515:595, 450:545]  # 80*95
img[515:595, 170:265] = ball

# 目标：获取RGB通道
b, g, r = cv2.split(img)
img = cv2.merge([b, g, r])
b1 = img[:, :, 2]  # bgr通道 分别对应0,1,2
# img[:, :, 2] = 0  # 把所有的红色通道对应为0
# print(b1)

cv2.imshow('test', img)
cv2.waitKey(0)
